#!/usr/bin/runghc

module Main where

-- local
import Language.Dependencies.References (readRelation)
import Language.Dependencies.Consistency (check) 

-- to get the argument
import System.Environment(getArgs)

main :: IO ()
main = do
   -- get the commandline argument
   -- read the file from disk       
   -- parse all lines as references
   [rulefile] <- getArgs
   contents <- readFile rulefile
   let references = (map readRelation) $ lines $ contents

   -- for all references, call "check"
   results <- mapM check references

   -- print all results, zipped with their references 
   mapM_ print $ (zip references results)
